using System;
using System.Collections.Generic;
using System.Text;
using EntityLayer;
using DataAccessLayer;
using System.Data;

namespace DataLayer
{
    public class datSearchLogs
    {
        public void InsertSearchLogs(entSearchLogs parEntSearchLogs, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.AddOutput("@pSearchLogId", DbType.Int32);
            insDbParamCollection.Add("@pSearchLogText", parEntSearchLogs.SearchLogText);
            insDbParamCollection.Add("@pSearchLogDate", DateTime.Now);
            parDbConnector.ExecuteNonQuery("InsertSearchLogs", insDbParamCollection);
        }
        public DataTable ReportSearchLogsMain(DateTime parStartDate, DateTime parEndDate, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pStartDate", parStartDate);
            insDbParamCollection.Add("@pEndDate", parEndDate);
            return parDbConnector.ExecuteDataTable("ReportSearchLogsMain", insDbParamCollection);
        }
        public DataTable ReportSearchLogsDetail(DateTime parStartDate, DateTime parEndDate, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pStartDate", parStartDate);
            insDbParamCollection.Add("@pEndDate", parEndDate);
            return parDbConnector.ExecuteDataTable("ReportSearchLogsDetail",insDbParamCollection);
        }
    }
}
